package com.example.design.patterns.冰河.结构型模式.外观模式.facede;

import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.ServiceA;
import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.ServiceB;
import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.ServiceC;
import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.impl.ServiceAImpl;
import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.impl.ServiceBImpl;
import com.example.design.patterns.冰河.结构型模式.外观模式.subSystemClasses.impl.ServiceCImpl;

/**
 * Facade 知道那些子系统类负责处理请求，将客户的请求代理给适当的子系统对象
 */
public class Facade {
    ServiceA sa;
    ServiceB sb;
    ServiceC sc;

    public Facade() {
        this.sa = new ServiceAImpl();
        this.sb = new ServiceBImpl();
        this.sc = new ServiceCImpl();
    }

    public void methodA() {
        sa.methodA();
        sb.methodB();
    }

    public void methodB() {
        sb.methodB();
        sc.methodC();
    }

    public void methodC() {
        sc.methodC();
        sa.methodA();
    }
}
